//
//  CommentTableViewCell.swift
//  ShareUmbrella
//
//  Created by niupark on 2017/9/9.
//  Copyright © 2017年 尧尚信息科技. All rights reserved.
//

import UIKit
import YSKit

class CommentTableViewCell: YSBaseTableViewCell {

    let nameLabel = UILabel()
    let dateLabel = UILabel()
    let commontLabel = UILabel()
    let headlogView = UIImageView()
    var startView: TQStarRatingView!

    override func setup() {
        super.setup()
//        self.contentView.backgroundColor =  UIColor(red: 0xF0 / 255.0, green: 0xF0 / 255.0, blue: 0xF0 / 255.0, alpha: 1)
        self.contentView.backgroundColor = .white
        let bkView = UIView().ys.customize { (view) in
            self.addSubview(view)
            view.backgroundColor =  UIColor(red: 0xF0 / 255.0, green: 0xF0 / 255.0, blue: 0xF0 / 255.0, alpha: 1)
            view.snp.makeConstraints({ (make) in
                make.top.equalTo(self).offset(10)
                make.leading.trailing.bottom.equalTo(self)
            })

        }
        self.headlogView.ys.customize { (view) in
            bkView.addSubview(view)
            view.image = UIImage(named: "头像")
            view.snp.makeConstraints({ (make) in
                make.centerY.equalTo(bkView)
                make.leading.equalTo(bkView).offset(20)
                make.width.height.equalTo(50)
            })
        }
        
        self.nameLabel.ys.customize { (view) in
            bkView.addSubview(view)
            view.text = "小明"
            view.textColor = .black
            view.font = YSFont.t04.font
            view.snp.makeConstraints({ (make) in
                make.leading.equalTo(self.headlogView.snp.trailing).offset(10)
                make.top.equalTo(self.headlogView)
            })
        }
        
        self.dateLabel.ys.customize { (view) in
            bkView.addSubview(view)
            view.text = "2017-09-01"
            view.textColor = .black
            view.font = YSFont.t04.font
            view.snp.makeConstraints({ (make) in
                make.trailing.equalTo(bkView).offset(-10)
                make.top.equalTo(self.headlogView)
            })
        }
        
        
        self.startView =  TQStarRatingView(frame: CGRect(x: 80, y: 50, width: 180, height: 25)).ys.customize { (view) in
            bkView.addSubview(view)
        }
        self.commontLabel.ys.customize { (view) in
            bkView.addSubview(view)
            view.text = "帮助很好,谢谢你带我走过这条路"
            view.textColor = YSColor.c103.color
            view.font = YSFont.t05.font
            view.snp.makeConstraints({ (make) in
                make.leading.equalTo(self.nameLabel)
                make.trailing.equalTo(bkView).offset(-10)
                make.top.equalTo(self.headlogView.snp.bottom)
            })
        }
        
        
    }
    
  
}
